package com.bwie.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.bwie.pojo.Spe;
import com.bwie.pojo.SpeOption;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author DarkClown
 * @date 2024-07-22 16:13
 * @project_name hight5
 * @parem
 **/
@Mapper
public interface SpeMapper extends BaseMapper<Spe> {

    @Delete("delete from tb_specification_option where id = #{id}")
    void deleteByOption(Spe spe);

    void insertOption(@Param("speOptions") List<SpeOption> speOptions,@Param("id") Integer id);

    @Delete("delete from tb_specification_option where spec_id = #{id}")
    void deleteByIdToOption(Integer id);

    @Select("select * from tb_specification_option where spec_id = #{id}")
    List<SpeOption> selectSpeOption(Integer id);
}
